<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@page import="com.asaga.tools.*, java.util.*, java.io.*, java.net.*, java.util.*"%>
<%--
     Author:  Jeremy Sanderlin 
     Date Created: 2007-03-19
     Last Modified: 2006-03-19
     Last Modified By: Jeremy Sanderlin
--%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<% 
    String numUsers2Validate = (String)session.getAttribute("numUsers2Validate");
    TreeSet autismAdminGroupTreeSet = (TreeSet)session.getAttribute("autismAdminGroupTreeSet");
    TreeSet autismRegularGroupTreeSet = (TreeSet)session.getAttribute("autismRegularGroupTreeSet");
    TreeSet autismNoValidGroupTreeSet = (TreeSet)session.getAttribute("autismNoValidGroupTreeSet");
    Iterator iterator = null;
    AutismGroup autismGroup = null;
    String username = (String)session.getAttribute("username");
    if(username==null){
        response.sendRedirect("login.jsp?message=Please log in again.");
    }
    SystemClient_DBImpl userProfile = (SystemClient_DBImpl)session.getAttribute("userProfile");
%>
<html>
    <%@ include file="header.jsp" %>
    <body>
        <div id="container">
            <%@ include file="topNav.jsp" %>
            <%@ include file="leftside.jsp" %>
            <%@ include file="rightside.jsp" %>
                <div id="content">
                <table border="0">
                    <tr>
                        <td><a href="AutismSiteMasterController?action=group&groupAction=list">List All Groups  </a></td>
                    </tr>
                </table>
                <br />
                <hr />
                <br />
                <h1>My Groups</h1>
                
                <table border="0">
                    <tr><td colspan="3"><label>Groups you administer or own</label></td></tr>
                    <% if(autismAdminGroupTreeSet == null){%>
                    <tr><td>No groups</td></tr>
                    <% }else{%>
                    <% iterator = autismAdminGroupTreeSet.iterator();    %>
                    <% if(!iterator.hasNext()){%>
                    <tr><td>No groups</td></tr>
                    <% } %>            
                    <% while(iterator.hasNext()){%>
                    <% autismGroup = (AutismGroup)iterator.next(); %>
                    <tr>

                        <td><%=autismGroup.GetGroupName()%> </td>
                        <td><table id="Table_01" width="105" height="31" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td colspan="3">
                                    <img src="images/forumbutton/forumbutton_01.gif" width="105" height="1" alt=""></td>
                            </tr>
                            <tr>
                                <td rowspan="2">
                                    <img src="images/forumbutton/forumbutton_02.gif" width="1" height="30" alt="Go To Forum"></td>
                                <td>
                                    <a href="AutismSiteMasterController?action=group&groupAction=forum&groupId=<%=autismGroup.GetGroupId()%>"
                                        onmouseover="changeImages('forumbutton_Shape_1', 'images/forumbutton/forumbutton_Shape-1-over.gif'); return true;"
                                        onmouseout="changeImages('forumbutton_Shape_1', 'images/forumbutton/forumbutton_Shape-1.gif'); return true;"
                                        onmousedown="changeImages('forumbutton_Shape_1', 'images/forumbutton/forumbutton_Shape-1-down.gif'); return true;"
                                        onmouseup="changeImages('forumbutton_Shape_1', 'images/forumbutton/forumbutton_Shape-1-over.gif'); return true;">
                                        <img name="forumbutton_Shape_1" src="images/forumbutton/forumbutton_Shape-1.gif" width="103" height="29" border="0" alt=""></a></td>
                                <td rowspan="2">
                                    <img src="images/forumbutton/forumbutton_04.gif" width="1" height="30" alt="Go to Forum"></td>
                            </tr>
                            <tr>
                                <td>
                                    <img src="images/forumbutton/forumbutton_05.gif" width="103" height="1" alt=""></td>
                            </tr>
                        </table>
                    </a>
                    </tr>                    
                    <% } %>
                    <%  } %>
                    <tr><td colspan="3"><label>Groups you are an active member</label></td></tr>
                    <% if(autismRegularGroupTreeSet == null){%>
                    <tr><td>No groups</td></tr>
                    <% }else{%>
                    <% iterator = autismRegularGroupTreeSet.iterator();    %>
                    <% if(!iterator.hasNext()){%>
                    <tr><td>No groups</td></tr>
                    <% } %>
                    <% while(iterator.hasNext()){%>
                    <% autismGroup = (AutismGroup)iterator.next(); %>
                    <tr>

                        <td><%=autismGroup.GetGroupName()%> </td>
                        <td><a href=AutismSiteMasterController?action=group&groupAction=forum&groupId=<%=autismGroup.GetGroupId()%>>
                            Go to Forum
                        </a>
                    </tr>                    
                    <% } %>
                    <%  } %>        
                    <tr><td colspan="3"><label>Groups you are waiting validation</label></td></tr>
                    <% if(autismNoValidGroupTreeSet == null){%>
                    <tr><td>No groups</td></tr>
                    <% }else{%>
                    <% iterator = autismNoValidGroupTreeSet.iterator();    %>
                    <% if(!iterator.hasNext()){%>
                    <tr><td colspan="2">No groups</td></tr>
                    <% } %>            
                    <% while(iterator.hasNext()){%>
                    <% autismGroup = (AutismGroup)iterator.next(); %>
                    <tr>

                        <td><%=autismGroup.GetGroupName()%> </td>
                    </tr>                    
                    <% } %>
                    <%  } %>        
                </table>
                <br />
                <hr />
                <br />
                <table border="0" cellpadding="1" cellspacing="2">
                    <tr>
                        <td><label>Number of people awaiting your approval for group admission</label></td>
                        <td>
                            <a href=AutismSiteMasterController?action=group&groupAction=userList2Validate>
                                <b><%=numUsers2Validate%></b>
                            </a>
                        </td>
                    </tr>
                </table>
            </div>
            <%@ include file="footer.jsp" %>
        </div>
    </body>
</html>
